package xyz.bali16.module.search.service;

import org.elasticsearch.action.bulk.BulkResponse;
import org.elasticsearch.action.delete.DeleteResponse;
import xyz.bali16.module.search.entity.QuestionEntity;
import xyz.bali16.module.search.model.SearchParam;
import xyz.bali16.module.search.model.SearchResultTo;
import xyz.bali16.module.search.model.UserRecordEntity;

import java.io.IOException;
import java.util.List;

public interface QuestionService  {

    void createIndex(String indexName,String mappingTemplate) throws IOException;

    void deleteHotelIndex() throws IOException;

    BulkResponse insert(List<QuestionEntity> questionEntities) throws IOException;
    BulkResponse insertUserRecords(List<UserRecordEntity> entities) throws IOException;

    DeleteResponse deleteById(Long id);

    SearchResultTo search(SearchParam param);
    SearchResultTo searchMulti(SearchParam param);

    List<String> hotWords();

    void saveHotWord(SearchParam searchParam) throws IOException;

    List<String> getSuggestions(String prefix) throws IOException;

}
